package com.js.nickcar.entity.local;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.ArrayList;

/**
 * Created by LZY on 2017/10/8.
 */

public class UploadCarPhotoBean implements Parcelable {

    public interface Type{
        String TYPE_APPEARANCE = "appearance";
        String TYPE_INTERIOR = "interior";
        String TYPE_ENGINE = "engine";
        String TYPE_OTHER = "other";
    }

    public UploadCarPhotoBean(String type, String title) {
        this.type = type;
        this.title = title;
    }

    private String type;
    private String title;
    private ArrayList<UploadPhotoBean> uploadPhotos = new ArrayList<>();

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public ArrayList<UploadPhotoBean> getUploadPhotos() {
        return uploadPhotos;
    }

    public void setUploadPhotos(ArrayList<UploadPhotoBean> uploadPhotos) {
        this.uploadPhotos = uploadPhotos;
    }

    @Override
    public String toString() {
        return "UploadCarPhotoBean{" +
                "title='" + title + '\'' +
                ", type='" + type + '\'' +
                ", uploadPhotos=" + uploadPhotos +
                '}';
    }


    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.type);
        dest.writeString(this.title);
        dest.writeTypedList(this.uploadPhotos);
    }

    protected UploadCarPhotoBean(Parcel in) {
        this.type = in.readString();
        this.title = in.readString();
        this.uploadPhotos = in.createTypedArrayList(UploadPhotoBean.CREATOR);
    }

    public static final Creator<UploadCarPhotoBean> CREATOR = new Creator<UploadCarPhotoBean>() {
        @Override
        public UploadCarPhotoBean createFromParcel(Parcel source) {
            return new UploadCarPhotoBean(source);
        }

        @Override
        public UploadCarPhotoBean[] newArray(int size) {
            return new UploadCarPhotoBean[size];
        }
    };
}
